import request from '@/utils/request'
// 品牌模块数据模块
// 获取品牌列表
// /admin/product/baseTrademark/{page}/{limit}
export const reqTrandeMark = (page, limit) => request({
  url: `/admin/product/baseTrademark/${page}/${limit}`,
  method: 'GET'
})

// 新增品牌 参数：品牌名称 品牌logo
// POST:/admin/product/baseTrademark/save
// 修改品牌 参数：id 品牌名称 品牌logo
// PUT :/admin /product /baseTrademark/update
export const reqAddOrUpdateMark = tradeMark => {
  if (tradeMark.id) {
    console.log(tradeMark)
    return request({
      url: '/admin/product/baseTrademark/update',
      method: 'PUT',
      data: tradeMark
    })
  } else {
    return request({
      url: '/admin/product/baseTrademark/save',
      method: 'POST',
      data: tradeMark
    })
  }
}
// DELETE:/admin/product/baseTrademark/remove/${id}
export const reqDeleteTradeMark = id => request({
  url: `/admin/product/baseTrademark/remove/${id}`,
  method: 'DELETE'
})
